package com.yonyou.isv.demo.openapi.api.settlement;

import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataArrayResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import com.yonyou.isv.demo.openapi.api.BaseOpenApi;
import com.yonyou.isv.demo.openapi.api.OpenApiURL;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @description: 用友开放平台接口结算方式
 * @author: zpp
 * @create: 2021-07-26
 **/
@Component
public class SettlementTypeApi extends BaseOpenApi {
    public Map<String, Object> save(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.SETTLETYPE_SAVE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> batchSave(Map<String, Object> params) {
        ApiDataResponse apiDataResponse =  postForEntity(OpenApiURL.SETTLETYPE_BATCHSAVE,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public List<Map<String, Object>> tree(Map<String, Object> params) {
        ApiDataArrayResponse apiDataResponse =  postForEntity(OpenApiURL.SETTLETYPE_TREE,params, ApiDataArrayResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String, Object> detail(Map<String, String> params) {
        ApiDataResponse apiDataResponse =  getForEntity(OpenApiURL.SETTLETYPE_DETAIL,params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> enable(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.SETTLETYPE_ENABLE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    /**
     * 结算方式对照保存
     */
    public Map<String,Object> contrastSave(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.SETTLECON_SAVE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    /**
     * 结算方式对照列表
     */
    public Map<String,Object> list(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.SETTLECON_LIST, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }


}
